package com.example.edu.Controller;

import com.example.edu.Dto.Return;
import com.example.edu.Entity.Course;
import com.example.edu.Service.SituationService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/situation")
public class SituationController {
    @Resource
    SituationService situationService;

    @PostMapping("/timeAndWords")
    public Return timeAndWords(HttpServletRequest httpServletRequest, @RequestBody Course course_id){
        return situationService.timeAndWords(httpServletRequest, course_id);
    }

    @PostMapping("/timePercent")
    public Return timePercent(HttpServletRequest httpServletRequest){
        return situationService.timePercent(httpServletRequest);
    }

    @PostMapping("/likeCollectView")
    public Return likeCollectView(HttpServletRequest httpServletRequest, @RequestBody Course course_id){
        return situationService.likeCollectView(httpServletRequest,course_id);
    }

    @PostMapping("/rankingList")
    public Return rankingList(HttpServletRequest httpServletRequest, @RequestBody Course course_id){
        return situationService.rankingList(httpServletRequest,course_id);
    }
}
